#include <stdio.h>
#include <stdlib.h>

void filecopy(FILE *ifp, FILE *ofp);

int main(int argc, char *argv[])
{
  FILE *fp;
  // accept argv[1+] as filenames, and transform them into FILE*
  for (int i = 1; i < argc; i++) {
    // printf("%s\n", argv[i]);
    fp = fopen(argv[i], "r");

    filecopy(fp, stdout);
    fclose(fp);
  }

  return EXIT_SUCCESS;
}

void filecopy(FILE *ifp, FILE *ofp) {
  int c;
  while ((c = getc(ifp)) != EOF) {
    putc(c, ofp);
  }
}
